package com.tanhua.domain.vo;

import cn.hutool.core.bean.BeanUtil;
import com.tanhua.domain.db.Question;
import com.tanhua.domain.mongo.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SoulVo {
    private String id;//id
    private String name;//试卷名字
    private String cover;//试卷封面
    private String level;//试卷等级
    private Integer star;//试卷难度星级
    private List<QuestionsVo> questions;//试题
    private Integer isLock;//试卷是否解锁
    private String reportId;//最新报告id

    public List<QuestionsVo> addQuestions(List<Questions> questions){
        List<QuestionsVo> voList = new ArrayList<>();
        for (Questions question : questions) {
            QuestionsVo questionsVo = new QuestionsVo();
            BeanUtil.copyProperties(question,questionsVo);
            voList.add(questionsVo);
        }
        return voList;
    }

}
